<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    .div1, .div2 {
      width: 200px;
      height: 200px;
      padding: 50px;
      border: 10px solid red;
      margin: 10px;
    }
    .div1 {
      box-sizing: border-box;
    }
    .div2 {
      box-sizing: content-box;
    }
  </style>
</head>
<body>
  <div class="div1">border-box</div>
  <div class="div2">content-box</div>
  <script>
    let person = {};
    Object.defineProperty(person, 'name', {
      writable: true,
      value: 'Jack'
    })
    console.log(person);
    let book = {
      _year: 2004,
      edition: 1
    };
    Object.defineProperty(book, 'year', {
      get: function() {
        return this._year+1;
      },
      set: function(val) {
        if(val > 2004) {
          this._year = val
          this.edition += val - 2004
        }
      }
    })
    book.year = 2000
    console.log(book)
  </script>
</body>
</html>